home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / pbc23c.arj / MAVGS.BAS < prev    next >
BASIC Source File  |  1994-03-13  |  817b  |  25 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1994  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7. SUB MeanAverageS (Array!(), First%, Last%, Average!, ErrCode%)
  8.    ErrCode% = 0
  9.    IF First% = 0 THEN
  10.       F% = LBOUND(Array!, 1)
  11.    ELSE
  12.       F% = First%
  13.    END IF
  14.    IF Last% = 0 OR Last% < First% THEN
  15.       L% = UBOUND(Array!, 1)
  16.    ELSE
  17.       L% = Last%
  18.    END IF
  19.    FOR Tmp% = F% TO L%
  20.       Total# = Total# + Array!(Tmp%)
  21.       Count% = Count% + 1
  22.    NEXT
  23.    Average! = Total# / CSNG(Count%)
  24. END SUB
  25.